package tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass.parameterSize.nonNullObject

import com.fasterxml.jackson.annotation.JsonCreator
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import tools.jackson.module.kotlin.assertReflectEquals
import tools.jackson.module.kotlin.callPrimaryConstructor
import tools.jackson.module.kotlin.defaultMapper
import tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass.NonNullObject
import tools.jackson.module.kotlin.readValue

// Convert the property p to q (but not the value) to make it an input to the factory function.
private fun replacePQ(src: String) = src.replace(Regex("""p\d+":""")) { "q" + it.value.substring(1) }

/**
 * Up to argument size 32 there is one mask argument for the default argument,
 * 33 ~ 64 there are two, and 65 there are three, so each boundary value is tested.
 * Also, the maximum size of arguments that can be set by a constructor
 * that includes a value class as an argument is 253 (one less by DefaultConstructorMarker), so test that case as well.
 */
class DeserializeByFactoryWithoutDefaultArgumentsTest {
    data class Dst32(
        val p00: NonNullObject,
        val p01: NonNullObject,
        val p02: NonNullObject,
        val p03: NonNullObject,
        val p04: NonNullObject,
        val p05: NonNullObject,
        val p06: NonNullObject,
        val p07: NonNullObject,
        val p08: NonNullObject,
        val p09: NonNullObject,
        val p10: NonNullObject,
        val p11: NonNullObject,
        val p12: NonNullObject,
        val p13: NonNullObject,
        val p14: NonNullObject,
        val p15: NonNullObject,
        val p16: NonNullObject,
        val p17: NonNullObject,
        val p18: NonNullObject,
        val p19: NonNullObject,
        val p20: NonNullObject,
        val p21: NonNullObject,
        val p22: NonNullObject,
        val p23: NonNullObject,
        val p24: NonNullObject,
        val p25: NonNullObject,
        val p26: NonNullObject,
        val p27: NonNullObject,
        val p28: NonNullObject,
        val p29: NonNullObject,
        val p30: NonNullObject,
        val p31: NonNullObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NonNullObject,
                q01: NonNullObject,
                q02: NonNullObject,
                q03: NonNullObject,
                q04: NonNullObject,
                q05: NonNullObject,
                q06: NonNullObject,
                q07: NonNullObject,
                q08: NonNullObject,
                q09: NonNullObject,
                q10: NonNullObject,
                q11: NonNullObject,
                q12: NonNullObject,
                q13: NonNullObject,
                q14: NonNullObject,
                q15: NonNullObject,
                q16: NonNullObject,
                q17: NonNullObject,
                q18: NonNullObject,
                q19: NonNullObject,
                q20: NonNullObject,
                q21: NonNullObject,
                q22: NonNullObject,
                q23: NonNullObject,
                q24: NonNullObject,
                q25: NonNullObject,
                q26: NonNullObject,
                q27: NonNullObject,
                q28: NonNullObject,
                q29: NonNullObject,
                q30: NonNullObject,
                q31: NonNullObject
            ) = Dst32(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31
            )
        }
    }

    @Test
    fun test32() {
        val expected = callPrimaryConstructor<Dst32> { NonNullObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst32>(src))
    }

    data class Dst33(
        val p00: NonNullObject,
        val p01: NonNullObject,
        val p02: NonNullObject,
        val p03: NonNullObject,
        val p04: NonNullObject,
        val p05: NonNullObject,
        val p06: NonNullObject,
        val p07: NonNullObject,
        val p08: NonNullObject,
        val p09: NonNullObject,
        val p10: NonNullObject,
        val p11: NonNullObject,
        val p12: NonNullObject,
        val p13: NonNullObject,
        val p14: NonNullObject,
        val p15: NonNullObject,
        val p16: NonNullObject,
        val p17: NonNullObject,
        val p18: NonNullObject,
        val p19: NonNullObject,
        val p20: NonNullObject,
        val p21: NonNullObject,
        val p22: NonNullObject,
        val p23: NonNullObject,
        val p24: NonNullObject,
        val p25: NonNullObject,
        val p26: NonNullObject,
        val p27: NonNullObject,
        val p28: NonNullObject,
        val p29: NonNullObject,
        val p30: NonNullObject,
        val p31: NonNullObject,
        val p32: NonNullObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NonNullObject,
                q01: NonNullObject,
                q02: NonNullObject,
                q03: NonNullObject,
                q04: NonNullObject,
                q05: NonNullObject,
                q06: NonNullObject,
                q07: NonNullObject,
                q08: NonNullObject,
                q09: NonNullObject,
                q10: NonNullObject,
                q11: NonNullObject,
                q12: NonNullObject,
                q13: NonNullObject,
                q14: NonNullObject,
                q15: NonNullObject,
                q16: NonNullObject,
                q17: NonNullObject,
                q18: NonNullObject,
                q19: NonNullObject,
                q20: NonNullObject,
                q21: NonNullObject,
                q22: NonNullObject,
                q23: NonNullObject,
                q24: NonNullObject,
                q25: NonNullObject,
                q26: NonNullObject,
                q27: NonNullObject,
                q28: NonNullObject,
                q29: NonNullObject,
                q30: NonNullObject,
                q31: NonNullObject,
                q32: NonNullObject
            ) = Dst33(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32
            )
        }
    }

    @Test
    fun test33() {
        val expected = callPrimaryConstructor<Dst33> { NonNullObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst33>(src))
    }

    data class Dst64(
        val p00: NonNullObject,
        val p01: NonNullObject,
        val p02: NonNullObject,
        val p03: NonNullObject,
        val p04: NonNullObject,
        val p05: NonNullObject,
        val p06: NonNullObject,
        val p07: NonNullObject,
        val p08: NonNullObject,
        val p09: NonNullObject,
        val p10: NonNullObject,
        val p11: NonNullObject,
        val p12: NonNullObject,
        val p13: NonNullObject,
        val p14: NonNullObject,
        val p15: NonNullObject,
        val p16: NonNullObject,
        val p17: NonNullObject,
        val p18: NonNullObject,
        val p19: NonNullObject,
        val p20: NonNullObject,
        val p21: NonNullObject,
        val p22: NonNullObject,
        val p23: NonNullObject,
        val p24: NonNullObject,
        val p25: NonNullObject,
        val p26: NonNullObject,
        val p27: NonNullObject,
        val p28: NonNullObject,
        val p29: NonNullObject,
        val p30: NonNullObject,
        val p31: NonNullObject,
        val p32: NonNullObject,
        val p33: NonNullObject,
        val p34: NonNullObject,
        val p35: NonNullObject,
        val p36: NonNullObject,
        val p37: NonNullObject,
        val p38: NonNullObject,
        val p39: NonNullObject,
        val p40: NonNullObject,
        val p41: NonNullObject,
        val p42: NonNullObject,
        val p43: NonNullObject,
        val p44: NonNullObject,
        val p45: NonNullObject,
        val p46: NonNullObject,
        val p47: NonNullObject,
        val p48: NonNullObject,
        val p49: NonNullObject,
        val p50: NonNullObject,
        val p51: NonNullObject,
        val p52: NonNullObject,
        val p53: NonNullObject,
        val p54: NonNullObject,
        val p55: NonNullObject,
        val p56: NonNullObject,
        val p57: NonNullObject,
        val p58: NonNullObject,
        val p59: NonNullObject,
        val p60: NonNullObject,
        val p61: NonNullObject,
        val p62: NonNullObject,
        val p63: NonNullObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NonNullObject,
                q01: NonNullObject,
                q02: NonNullObject,
                q03: NonNullObject,
                q04: NonNullObject,
                q05: NonNullObject,
                q06: NonNullObject,
                q07: NonNullObject,
                q08: NonNullObject,
                q09: NonNullObject,
                q10: NonNullObject,
                q11: NonNullObject,
                q12: NonNullObject,
                q13: NonNullObject,
                q14: NonNullObject,
                q15: NonNullObject,
                q16: NonNullObject,
                q17: NonNullObject,
                q18: NonNullObject,
                q19: NonNullObject,
                q20: NonNullObject,
                q21: NonNullObject,
                q22: NonNullObject,
                q23: NonNullObject,
                q24: NonNullObject,
                q25: NonNullObject,
                q26: NonNullObject,
                q27: NonNullObject,
                q28: NonNullObject,
                q29: NonNullObject,
                q30: NonNullObject,
                q31: NonNullObject,
                q32: NonNullObject,
                q33: NonNullObject,
                q34: NonNullObject,
                q35: NonNullObject,
                q36: NonNullObject,
                q37: NonNullObject,
                q38: NonNullObject,
                q39: NonNullObject,
                q40: NonNullObject,
                q41: NonNullObject,
                q42: NonNullObject,
                q43: NonNullObject,
                q44: NonNullObject,
                q45: NonNullObject,
                q46: NonNullObject,
                q47: NonNullObject,
                q48: NonNullObject,
                q49: NonNullObject,
                q50: NonNullObject,
                q51: NonNullObject,
                q52: NonNullObject,
                q53: NonNullObject,
                q54: NonNullObject,
                q55: NonNullObject,
                q56: NonNullObject,
                q57: NonNullObject,
                q58: NonNullObject,
                q59: NonNullObject,
                q60: NonNullObject,
                q61: NonNullObject,
                q62: NonNullObject,
                q63: NonNullObject
            ) = Dst64(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32,
                q33,
                q34,
                q35,
                q36,
                q37,
                q38,
                q39,
                q40,
                q41,
                q42,
                q43,
                q44,
                q45,
                q46,
                q47,
                q48,
                q49,
                q50,
                q51,
                q52,
                q53,
                q54,
                q55,
                q56,
                q57,
                q58,
                q59,
                q60,
                q61,
                q62,
                q63
            )
        }
    }

    @Test
    fun test64() {
        val expected = callPrimaryConstructor<Dst64> { NonNullObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst64>(src))
    }

    data class Dst65(
        val p00: NonNullObject,
        val p01: NonNullObject,
        val p02: NonNullObject,
        val p03: NonNullObject,
        val p04: NonNullObject,
        val p05: NonNullObject,
        val p06: NonNullObject,
        val p07: NonNullObject,
        val p08: NonNullObject,
        val p09: NonNullObject,
        val p10: NonNullObject,
        val p11: NonNullObject,
        val p12: NonNullObject,
        val p13: NonNullObject,
        val p14: NonNullObject,
        val p15: NonNullObject,
        val p16: NonNullObject,
        val p17: NonNullObject,
        val p18: NonNullObject,
        val p19: NonNullObject,
        val p20: NonNullObject,
        val p21: NonNullObject,
        val p22: NonNullObject,
        val p23: NonNullObject,
        val p24: NonNullObject,
        val p25: NonNullObject,
        val p26: NonNullObject,
        val p27: NonNullObject,
        val p28: NonNullObject,
        val p29: NonNullObject,
        val p30: NonNullObject,
        val p31: NonNullObject,
        val p32: NonNullObject,
        val p33: NonNullObject,
        val p34: NonNullObject,
        val p35: NonNullObject,
        val p36: NonNullObject,
        val p37: NonNullObject,
        val p38: NonNullObject,
        val p39: NonNullObject,
        val p40: NonNullObject,
        val p41: NonNullObject,
        val p42: NonNullObject,
        val p43: NonNullObject,
        val p44: NonNullObject,
        val p45: NonNullObject,
        val p46: NonNullObject,
        val p47: NonNullObject,
        val p48: NonNullObject,
        val p49: NonNullObject,
        val p50: NonNullObject,
        val p51: NonNullObject,
        val p52: NonNullObject,
        val p53: NonNullObject,
        val p54: NonNullObject,
        val p55: NonNullObject,
        val p56: NonNullObject,
        val p57: NonNullObject,
        val p58: NonNullObject,
        val p59: NonNullObject,
        val p60: NonNullObject,
        val p61: NonNullObject,
        val p62: NonNullObject,
        val p63: NonNullObject,
        val p64: NonNullObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NonNullObject,
                q01: NonNullObject,
                q02: NonNullObject,
                q03: NonNullObject,
                q04: NonNullObject,
                q05: NonNullObject,
                q06: NonNullObject,
                q07: NonNullObject,
                q08: NonNullObject,
                q09: NonNullObject,
                q10: NonNullObject,
                q11: NonNullObject,
                q12: NonNullObject,
                q13: NonNullObject,
                q14: NonNullObject,
                q15: NonNullObject,
                q16: NonNullObject,
                q17: NonNullObject,
                q18: NonNullObject,
                q19: NonNullObject,
                q20: NonNullObject,
                q21: NonNullObject,
                q22: NonNullObject,
                q23: NonNullObject,
                q24: NonNullObject,
                q25: NonNullObject,
                q26: NonNullObject,
                q27: NonNullObject,
                q28: NonNullObject,
                q29: NonNullObject,
                q30: NonNullObject,
                q31: NonNullObject,
                q32: NonNullObject,
                q33: NonNullObject,
                q34: NonNullObject,
                q35: NonNullObject,
                q36: NonNullObject,
                q37: NonNullObject,
                q38: NonNullObject,
                q39: NonNullObject,
                q40: NonNullObject,
                q41: NonNullObject,
                q42: NonNullObject,
                q43: NonNullObject,
                q44: NonNullObject,
                q45: NonNullObject,
                q46: NonNullObject,
                q47: NonNullObject,
                q48: NonNullObject,
                q49: NonNullObject,
                q50: NonNullObject,
                q51: NonNullObject,
                q52: NonNullObject,
                q53: NonNullObject,
                q54: NonNullObject,
                q55: NonNullObject,
                q56: NonNullObject,
                q57: NonNullObject,
                q58: NonNullObject,
                q59: NonNullObject,
                q60: NonNullObject,
                q61: NonNullObject,
                q62: NonNullObject,
                q63: NonNullObject,
                q64: NonNullObject
            ) = Dst65(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32,
                q33,
                q34,
                q35,
                q36,
                q37,
                q38,
                q39,
                q40,
                q41,
                q42,
                q43,
                q44,
                q45,
                q46,
                q47,
                q48,
                q49,
                q50,
                q51,
                q52,
                q53,
                q54,
                q55,
                q56,
                q57,
                q58,
                q59,
                q60,
                q61,
                q62,
                q63,
                q64
            )
        }
    }

    @Test
    fun test65() {
        val expected = callPrimaryConstructor<Dst65> { NonNullObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst65>(src))
    }

    // It cannot be a data class because the generated method would exceed the argument size limit.
    class DstMax(
        val p000: NonNullObject,
        val p001: NonNullObject,
        val p002: NonNullObject,
        val p003: NonNullObject,
        val p004: NonNullObject,
        val p005: NonNullObject,
        val p006: NonNullObject,
        val p007: NonNullObject,
        val p008: NonNullObject,
        val p009: NonNullObject,
        val p010: NonNullObject,
        val p011: NonNullObject,
        val p012: NonNullObject,
        val p013: NonNullObject,
        val p014: NonNullObject,
        val p015: NonNullObject,
        val p016: NonNullObject,
        val p017: NonNullObject,
        val p018: NonNullObject,
        val p019: NonNullObject,
        val p020: NonNullObject,
        val p021: NonNullObject,
        val p022: NonNullObject,
        val p023: NonNullObject,
        val p024: NonNullObject,
        val p025: NonNullObject,
        val p026: NonNullObject,
        val p027: NonNullObject,
        val p028: NonNullObject,
        val p029: NonNullObject,
        val p030: NonNullObject,
        val p031: NonNullObject,
        val p032: NonNullObject,
        val p033: NonNullObject,
        val p034: NonNullObject,
        val p035: NonNullObject,
        val p036: NonNullObject,
        val p037: NonNullObject,
        val p038: NonNullObject,
        val p039: NonNullObject,
        val p040: NonNullObject,
        val p041: NonNullObject,
        val p042: NonNullObject,
        val p043: NonNullObject,
        val p044: NonNullObject,
        val p045: NonNullObject,
        val p046: NonNullObject,
        val p047: NonNullObject,
        val p048: NonNullObject,
        val p049: NonNullObject,
        val p050: NonNullObject,
        val p051: NonNullObject,
        val p052: NonNullObject,
        val p053: NonNullObject,
        val p054: NonNullObject,
        val p055: NonNullObject,
        val p056: NonNullObject,
        val p057: NonNullObject,
        val p058: NonNullObject,
        val p059: NonNullObject,
        val p060: NonNullObject,
        val p061: NonNullObject,
        val p062: NonNullObject,
        val p063: NonNullObject,
        val p064: NonNullObject,
        val p065: NonNullObject,
        val p066: NonNullObject,
        val p067: NonNullObject,
        val p068: NonNullObject,
        val p069: NonNullObject,
        val p070: NonNullObject,
        val p071: NonNullObject,
        val p072: NonNullObject,
        val p073: NonNullObject,
        val p074: NonNullObject,
        val p075: NonNullObject,
        val p076: NonNullObject,
        val p077: NonNullObject,
        val p078: NonNullObject,
        val p079: NonNullObject,
        val p080: NonNullObject,
        val p081: NonNullObject,
        val p082: NonNullObject,
        val p083: NonNullObject,
        val p084: NonNullObject,
        val p085: NonNullObject,
        val p086: NonNullObject,
        val p087: NonNullObject,
        val p088: NonNullObject,
        val p089: NonNullObject,
        val p090: NonNullObject,
        val p091: NonNullObject,
        val p092: NonNullObject,
        val p093: NonNullObject,
        val p094: NonNullObject,
        val p095: NonNullObject,
        val p096: NonNullObject,
        val p097: NonNullObject,
        val p098: NonNullObject,
        val p099: NonNullObject,
        val p100: NonNullObject,
        val p101: NonNullObject,
        val p102: NonNullObject,
        val p103: NonNullObject,
        val p104: NonNullObject,
        val p105: NonNullObject,
        val p106: NonNullObject,
        val p107: NonNullObject,
        val p108: NonNullObject,
        val p109: NonNullObject,
        val p110: NonNullObject,
        val p111: NonNullObject,
        val p112: NonNullObject,
        val p113: NonNullObject,
        val p114: NonNullObject,
        val p115: NonNullObject,
        val p116: NonNullObject,
        val p117: NonNullObject,
        val p118: NonNullObject,
        val p119: NonNullObject,
        val p120: NonNullObject,
        val p121: NonNullObject,
        val p122: NonNullObject,
        val p123: NonNullObject,
        val p124: NonNullObject,
        val p125: NonNullObject,
        val p126: NonNullObject,
        val p127: NonNullObject,
        val p128: NonNullObject,
        val p129: NonNullObject,
        val p130: NonNullObject,
        val p131: NonNullObject,
        val p132: NonNullObject,
        val p133: NonNullObject,
        val p134: NonNullObject,
        val p135: NonNullObject,
        val p136: NonNullObject,
        val p137: NonNullObject,
        val p138: NonNullObject,
        val p139: NonNullObject,
        val p140: NonNullObject,
        val p141: NonNullObject,
        val p142: NonNullObject,
        val p143: NonNullObject,
        val p144: NonNullObject,
        val p145: NonNullObject,
        val p146: NonNullObject,
        val p147: NonNullObject,
        val p148: NonNullObject,
        val p149: NonNullObject,
        val p150: NonNullObject,
        val p151: NonNullObject,
        val p152: NonNullObject,
        val p153: NonNullObject,
        val p154: NonNullObject,
        val p155: NonNullObject,
        val p156: NonNullObject,
        val p157: NonNullObject,
        val p158: NonNullObject,
        val p159: NonNullObject,
        val p160: NonNullObject,
        val p161: NonNullObject,
        val p162: NonNullObject,
        val p163: NonNullObject,
        val p164: NonNullObject,
        val p165: NonNullObject,
        val p166: NonNullObject,
        val p167: NonNullObject,
        val p168: NonNullObject,
        val p169: NonNullObject,
        val p170: NonNullObject,
        val p171: NonNullObject,
        val p172: NonNullObject,
        val p173: NonNullObject,
        val p174: NonNullObject,
        val p175: NonNullObject,
        val p176: NonNullObject,
        val p177: NonNullObject,
        val p178: NonNullObject,
        val p179: NonNullObject,
        val p180: NonNullObject,
        val p181: NonNullObject,
        val p182: NonNullObject,
        val p183: NonNullObject,
        val p184: NonNullObject,
        val p185: NonNullObject,
        val p186: NonNullObject,
        val p187: NonNullObject,
        val p188: NonNullObject,
        val p189: NonNullObject,
        val p190: NonNullObject,
        val p191: NonNullObject,
        val p192: NonNullObject,
        val p193: NonNullObject,
        val p194: NonNullObject,
        val p195: NonNullObject,
        val p196: NonNullObject,
        val p197: NonNullObject,
        val p198: NonNullObject,
        val p199: NonNullObject,
        val p200: NonNullObject,
        val p201: NonNullObject,
        val p202: NonNullObject,
        val p203: NonNullObject,
        val p204: NonNullObject,
        val p205: NonNullObject,
        val p206: NonNullObject,
        val p207: NonNullObject,
        val p208: NonNullObject,
        val p209: NonNullObject,
        val p210: NonNullObject,
        val p211: NonNullObject,
        val p212: NonNullObject,
        val p213: NonNullObject,
        val p214: NonNullObject,
        val p215: NonNullObject,
        val p216: NonNullObject,
        val p217: NonNullObject,
        val p218: NonNullObject,
        val p219: NonNullObject,
        val p220: NonNullObject,
        val p221: NonNullObject,
        val p222: NonNullObject,
        val p223: NonNullObject,
        val p224: NonNullObject,
        val p225: NonNullObject,
        val p226: NonNullObject,
        val p227: NonNullObject,
        val p228: NonNullObject,
        val p229: NonNullObject,
        val p230: NonNullObject,
        val p231: NonNullObject,
        val p232: NonNullObject,
        val p233: NonNullObject,
        val p234: NonNullObject,
        val p235: NonNullObject,
        val p236: NonNullObject,
        val p237: NonNullObject,
        val p238: NonNullObject,
        val p239: NonNullObject,
        val p240: NonNullObject,
        val p241: NonNullObject,
        val p242: NonNullObject,
        val p243: NonNullObject,
        val p244: NonNullObject,
        val p245: NonNullObject,
        val p246: NonNullObject,
        val p247: NonNullObject,
        val p248: NonNullObject,
        val p249: NonNullObject,
        val p250: NonNullObject,
        val p251: NonNullObject,
        val p252: NonNullObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q000: NonNullObject,
                q001: NonNullObject,
                q002: NonNullObject,
                q003: NonNullObject,
                q004: NonNullObject,
                q005: NonNullObject,
                q006: NonNullObject,
                q007: NonNullObject,
                q008: NonNullObject,
                q009: NonNullObject,
                q010: NonNullObject,
                q011: NonNullObject,
                q012: NonNullObject,
                q013: NonNullObject,
                q014: NonNullObject,
                q015: NonNullObject,
                q016: NonNullObject,
                q017: NonNullObject,
                q018: NonNullObject,
                q019: NonNullObject,
                q020: NonNullObject,
                q021: NonNullObject,
                q022: NonNullObject,
                q023: NonNullObject,
                q024: NonNullObject,
                q025: NonNullObject,
                q026: NonNullObject,
                q027: NonNullObject,
                q028: NonNullObject,
                q029: NonNullObject,
                q030: NonNullObject,
                q031: NonNullObject,
                q032: NonNullObject,
                q033: NonNullObject,
                q034: NonNullObject,
                q035: NonNullObject,
                q036: NonNullObject,
                q037: NonNullObject,
                q038: NonNullObject,
                q039: NonNullObject,
                q040: NonNullObject,
                q041: NonNullObject,
                q042: NonNullObject,
                q043: NonNullObject,
                q044: NonNullObject,
                q045: NonNullObject,
                q046: NonNullObject,
                q047: NonNullObject,
                q048: NonNullObject,
                q049: NonNullObject,
                q050: NonNullObject,
                q051: NonNullObject,
                q052: NonNullObject,
                q053: NonNullObject,
                q054: NonNullObject,
                q055: NonNullObject,
                q056: NonNullObject,
                q057: NonNullObject,
                q058: NonNullObject,
                q059: NonNullObject,
                q060: NonNullObject,
                q061: NonNullObject,
                q062: NonNullObject,
                q063: NonNullObject,
                q064: NonNullObject,
                q065: NonNullObject,
                q066: NonNullObject,
                q067: NonNullObject,
                q068: NonNullObject,
                q069: NonNullObject,
                q070: NonNullObject,
                q071: NonNullObject,
                q072: NonNullObject,
                q073: NonNullObject,
                q074: NonNullObject,
                q075: NonNullObject,
                q076: NonNullObject,
                q077: NonNullObject,
                q078: NonNullObject,
                q079: NonNullObject,
                q080: NonNullObject,
                q081: NonNullObject,
                q082: NonNullObject,
                q083: NonNullObject,
                q084: NonNullObject,
                q085: NonNullObject,
                q086: NonNullObject,
                q087: NonNullObject,
                q088: NonNullObject,
                q089: NonNullObject,
                q090: NonNullObject,
                q091: NonNullObject,
                q092: NonNullObject,
                q093: NonNullObject,
                q094: NonNullObject,
                q095: NonNullObject,
                q096: NonNullObject,
                q097: NonNullObject,
                q098: NonNullObject,
                q099: NonNullObject,
                q100: NonNullObject,
                q101: NonNullObject,
                q102: NonNullObject,
                q103: NonNullObject,
                q104: NonNullObject,
                q105: NonNullObject,
                q106: NonNullObject,
                q107: NonNullObject,
                q108: NonNullObject,
                q109: NonNullObject,
                q110: NonNullObject,
                q111: NonNullObject,
                q112: NonNullObject,
                q113: NonNullObject,
                q114: NonNullObject,
                q115: NonNullObject,
                q116: NonNullObject,
                q117: NonNullObject,
                q118: NonNullObject,
                q119: NonNullObject,
                q120: NonNullObject,
                q121: NonNullObject,
                q122: NonNullObject,
                q123: NonNullObject,
                q124: NonNullObject,
                q125: NonNullObject,
                q126: NonNullObject,
                q127: NonNullObject,
                q128: NonNullObject,
                q129: NonNullObject,
                q130: NonNullObject,
                q131: NonNullObject,
                q132: NonNullObject,
                q133: NonNullObject,
                q134: NonNullObject,
                q135: NonNullObject,
                q136: NonNullObject,
                q137: NonNullObject,
                q138: NonNullObject,
                q139: NonNullObject,
                q140: NonNullObject,
                q141: NonNullObject,
                q142: NonNullObject,
                q143: NonNullObject,
                q144: NonNullObject,
                q145: NonNullObject,
                q146: NonNullObject,
                q147: NonNullObject,
                q148: NonNullObject,
                q149: NonNullObject,
                q150: NonNullObject,
                q151: NonNullObject,
                q152: NonNullObject,
                q153: NonNullObject,
                q154: NonNullObject,
                q155: NonNullObject,
                q156: NonNullObject,
                q157: NonNullObject,
                q158: NonNullObject,
                q159: NonNullObject,
                q160: NonNullObject,
                q161: NonNullObject,
                q162: NonNullObject,
                q163: NonNullObject,
                q164: NonNullObject,
                q165: NonNullObject,
                q166: NonNullObject,
                q167: NonNullObject,
                q168: NonNullObject,
                q169: NonNullObject,
                q170: NonNullObject,
                q171: NonNullObject,
                q172: NonNullObject,
                q173: NonNullObject,
                q174: NonNullObject,
                q175: NonNullObject,
                q176: NonNullObject,
                q177: NonNullObject,
                q178: NonNullObject,
                q179: NonNullObject,
                q180: NonNullObject,
                q181: NonNullObject,
                q182: NonNullObject,
                q183: NonNullObject,
                q184: NonNullObject,
                q185: NonNullObject,
                q186: NonNullObject,
                q187: NonNullObject,
                q188: NonNullObject,
                q189: NonNullObject,
                q190: NonNullObject,
                q191: NonNullObject,
                q192: NonNullObject,
                q193: NonNullObject,
                q194: NonNullObject,
                q195: NonNullObject,
                q196: NonNullObject,
                q197: NonNullObject,
                q198: NonNullObject,
                q199: NonNullObject,
                q200: NonNullObject,
                q201: NonNullObject,
                q202: NonNullObject,
                q203: NonNullObject,
                q204: NonNullObject,
                q205: NonNullObject,
                q206: NonNullObject,
                q207: NonNullObject,
                q208: NonNullObject,
                q209: NonNullObject,
                q210: NonNullObject,
                q211: NonNullObject,
                q212: NonNullObject,
                q213: NonNullObject,
                q214: NonNullObject,
                q215: NonNullObject,
                q216: NonNullObject,
                q217: NonNullObject,
                q218: NonNullObject,
                q219: NonNullObject,
                q220: NonNullObject,
                q221: NonNullObject,
                q222: NonNullObject,
                q223: NonNullObject,
                q224: NonNullObject,
                q225: NonNullObject,
                q226: NonNullObject,
                q227: NonNullObject,
                q228: NonNullObject,
                q229: NonNullObject,
                q230: NonNullObject,
                q231: NonNullObject,
                q232: NonNullObject,
                q233: NonNullObject,
                q234: NonNullObject,
                q235: NonNullObject,
                q236: NonNullObject,
                q237: NonNullObject,
                q238: NonNullObject,
                q239: NonNullObject,
                q240: NonNullObject,
                q241: NonNullObject,
                q242: NonNullObject,
                q243: NonNullObject,
                q244: NonNullObject,
                q245: NonNullObject,
                q246: NonNullObject,
                q247: NonNullObject,
                q248: NonNullObject,
                q249: NonNullObject,
                q250: NonNullObject,
                q251: NonNullObject,
                q252: NonNullObject
            ) = DstMax(
                q000,
                q001,
                q002,
                q003,
                q004,
                q005,
                q006,
                q007,
                q008,
                q009,
                q010,
                q011,
                q012,
                q013,
                q014,
                q015,
                q016,
                q017,
                q018,
                q019,
                q020,
                q021,
                q022,
                q023,
                q024,
                q025,
                q026,
                q027,
                q028,
                q029,
                q030,
                q031,
                q032,
                q033,
                q034,
                q035,
                q036,
                q037,
                q038,
                q039,
                q040,
                q041,
                q042,
                q043,
                q044,
                q045,
                q046,
                q047,
                q048,
                q049,
                q050,
                q051,
                q052,
                q053,
                q054,
                q055,
                q056,
                q057,
                q058,
                q059,
                q060,
                q061,
                q062,
                q063,
                q064,
                q065,
                q066,
                q067,
                q068,
                q069,
                q070,
                q071,
                q072,
                q073,
                q074,
                q075,
                q076,
                q077,
                q078,
                q079,
                q080,
                q081,
                q082,
                q083,
                q084,
                q085,
                q086,
                q087,
                q088,
                q089,
                q090,
                q091,
                q092,
                q093,
                q094,
                q095,
                q096,
                q097,
                q098,
                q099,
                q100,
                q101,
                q102,
                q103,
                q104,
                q105,
                q106,
                q107,
                q108,
                q109,
                q110,
                q111,
                q112,
                q113,
                q114,
                q115,
                q116,
                q117,
                q118,
                q119,
                q120,
                q121,
                q122,
                q123,
                q124,
                q125,
                q126,
                q127,
                q128,
                q129,
                q130,
                q131,
                q132,
                q133,
                q134,
                q135,
                q136,
                q137,
                q138,
                q139,
                q140,
                q141,
                q142,
                q143,
                q144,
                q145,
                q146,
                q147,
                q148,
                q149,
                q150,
                q151,
                q152,
                q153,
                q154,
                q155,
                q156,
                q157,
                q158,
                q159,
                q160,
                q161,
                q162,
                q163,
                q164,
                q165,
                q166,
                q167,
                q168,
                q169,
                q170,
                q171,
                q172,
                q173,
                q174,
                q175,
                q176,
                q177,
                q178,
                q179,
                q180,
                q181,
                q182,
                q183,
                q184,
                q185,
                q186,
                q187,
                q188,
                q189,
                q190,
                q191,
                q192,
                q193,
                q194,
                q195,
                q196,
                q197,
                q198,
                q199,
                q200,
                q201,
                q202,
                q203,
                q204,
                q205,
                q206,
                q207,
                q208,
                q209,
                q210,
                q211,
                q212,
                q213,
                q214,
                q215,
                q216,
                q217,
                q218,
                q219,
                q220,
                q221,
                q222,
                q223,
                q224,
                q225,
                q226,
                q227,
                q228,
                q229,
                q230,
                q231,
                q232,
                q233,
                q234,
                q235,
                q236,
                q237,
                q238,
                q239,
                q240,
                q241,
                q242,
                q243,
                q244,
                q245,
                q246,
                q247,
                q248,
                q249,
                q250,
                q251,
                q252
            )
        }
    }

    @Test
    fun testMax() {
        val expected = callPrimaryConstructor<DstMax> { NonNullObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertReflectEquals(expected, defaultMapper.readValue<DstMax>(src))
    }
}
